package com.yalpuz.dao;

import com.yalpuz.entity.User;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Repository
public class UserDAO {

	@PersistenceContext
	protected EntityManager entityManager;

	public void save(User user) {
		if (user == null) {
			return;
		}
		User user1 = entityManager.find(User.class, 1);
		System.out.println(user1);
		entityManager.persist(user);
	}


}
